#lang racket


(require "../base/main.rkt")

(provide spline-tangents)


(define (spline-tangents cs)
  (let ((c0 (first cs))
        (c1 (second cs))
        (c2 (second (reverse cs)))
        (c3 (last cs)))
    (let ((begin-tangent (sub-c c1 c0))
          (end-tangent (sub-c c3 c2)))
      (values begin-tangent end-tangent))))